//如果用uni请求
import http from "@/common/uni.interface.js";
import store from "@/store/index.js";

const getters = store.getters;

//如果是用uview请求,就用下面这句
//const http = uni.$u.http
//用户登录
export function userLogin(params) {
  return http.post("/v1/login", params);
}
//首页展示汇总
export function indexData(params) {
  return http.post("/v1/report/show", params);
}
//首页展示余额
export function indexShow(params) {
  return http.post("/v1/user/head/cash_cost", params);
}
//首页展图表
export function indexGraph(params) {
  return http.post("/v1/user/day/graph", params);
}
//账户列表
export function accountList(params) {
  return http.post(
    getters.isAdmin ? "/v1/backend/super_users" : "/v1/backend/users",
    params
  );
}

export function ordersList(params) {
  return http.post(
    getters.isAdmin ? "/v1/backend/super_orders" : "/v1/backend/orders",
    params
  );
}

export function planList(params) {
  return http.post(
    getters.isAdmin ? "/v1/backend/super_plans" : "/v1/backend/all_plan",
    params
  );
}

export function queryPlan(params) {
  return http.post("/v1/backend/plan", params);
}

export function sonList(params) {
  return http.post(
    getters.isAdmin ? "/v1/admin/company/report" : "/v1/report/son",
    params
  );
}

export function updateStatus(params) {
  return http.post("/v1/plan/status/update", params);
}

export function updateBid(params) {
  return http.post("/v1/plan/bid/update", params);
}

export function updateBudget(params) {
  return http.post("/v1/plan/budget/update", params);
}

export function commentsList(params) {
  return http.post("/v1/backend/comments", params);
}

export function hideComment(params) {
  return http.post("/v1/comment/hide", params);
}

export function stickComment(params) {
  return http.post("/v1/comment/stick", params);
}

export function replyComment(params) {
  return http.post("/v1/comment/reply", params);
}

export function createTransfer(params) {
  return http.post("/v1/fund/transfer", params);
}

export function getTransfer(params) {
  return http.post("/v1/fund/transfer/list", params);
}
//产品
export function getProductList(params) {
    return http.post("/v1/merchant/product/list", params);
}
export function getAccountLogin(params) {
  return http.post("/v1/admin/account/login", params);
}
export function goodsReportList(params) {
  return http.post("/v1/admin/goods/report", params);
}
